package com.onpositive.data.serializer.writers;


import com.onpositive.data.serializer.readers.DefaultReaderFactory;
import com.onpositive.data.units.DateWithAccuracy;

public class DateWithAccuracyWriter extends CollectionWriter<DateWithAccuracy>{
	
	private final static DateWithAccuracy defaultDate = new DateWithAccuracy(0) ;

	public DateWithAccuracyWriter() {
		super(DateWithAccuracy.class);
	}
	
	@Override
	protected int getItemSize() {
		return 4;
	}

	@Override
	protected void writeValue( DateWithAccuracy w ) {

		int vl= w.getDateCode() ;
		super.writeIntToStream( vl );
	}

	@Override
	protected DateWithAccuracy defaultObject() {
		return defaultDate ;
	}
	
	@Override
	protected int getID()
	{
		return DefaultReaderFactory.RW_ID_DATE_WITH_ACCURACY  ;				
	}

}
